import {createRouter,createWebHistory,createWebHashHistory} from "vue-router";

//定义路由
const routes = [
    //后台管理员
    {name:'index',path:'/',component:()=>import('@/components/Index.vue'),children:[
            {name:'admin',path:'admin',component:()=>import('@/components/Admin.vue')},
            {name:'coach',path:'coach',component:()=>import('@/components/Coach.vue')},
            {name:'member',path:'member',component:()=>import('@/components/Member.vue')},
            {name:'course',path:'course',component:()=>import('@/components/Course.vue')},
            {name:'courseCalendar',path:'courseCalendar',component:()=>import('@/components/CourseCalendar.vue')},
            {name:'reserve',path:'reserve',component:()=>import('@/components/reserve.vue')},
            {name:'charts',path:'charts',component:()=>import('@/components/Charts.vue')},
            {name:'task',path:'task',component:()=>import('@/components/Task.vue')},
        ]},
    {name:'login',path:'/login',component:()=>import('@/components/Login.vue')},
]

//创建路由
const router = createRouter({
    history:createWebHashHistory(),
    routes:routes
})
export default router